package spotor.client.provider;

import android.net.Uri;
import android.provider.BaseColumns;

public class SpotorContract {
	//Spotor Uri类
	
	public static final String CONTENT_AUTHORITY = "spotor.client";
	private static final Uri BASE_CONTENT_URI = Uri.parse("content://"
			+ CONTENT_AUTHORITY);
	private static final String PATH_NEWS = "news";
	private static final String PATH_PLANS = "plans";
	private static final String PATH_DREAMS = "dreams";
	private static final String PATH_BLOGS = "blogs";
	private static final String PATH_FRIENDS = "friends";
	private static final String PATH_PHOTOS = "photos";
	private static final String PATH_STATES = "states";
	private static final String PATH_MAILS = "mails";

	// private static final String PATH_AT = "at";
	// private static final String PATH_BETWEEN = "between";
	// private static final String PATH_SEARCH = "search";
	// private static final String PATH_SEARCH_SUGGEST = "search_suggest_query";
	interface PlacesColumns{
		String PLACE_ID		=	"place_id";
		String PLACE_NAME	= 	"place_name";
		String LONGITUDE	= 	"longitude";
		String LATITUDE 	= 	"latitude";
	}
	
	
	interface PlansColumns{
		String PLAN_ID 			= 	"plan_id";
		String PLAN_TITLE 		= 	"plan_title";
		String PLNA_LOGO		=	"plan_logo";
		String PLAN_STATUS		= 	"plan_status";
		String PLAN_CONTENT 	= 	"plan_content";
		String PLAN_START_PLACE =	"plan_start_place";
		String PLAN_END_PLACE 	= 	"plan_end_place";
		String START_DATE 		= 	"start_date";
		String MEMBER_NUM 		= 	"member_num";
		String VIEW_OPEN		=	"view_open";
	}
		
	interface StatesColumns{
		String STATE_ID			=	"state_id";
		String STATE_CONTENT	=	"state_content";
		String STATE_CREATE_TIME=	"state_create_time";
	}
	
	interface PhotosColumns{
		String PHOTO_ID			=	"photo_id";
		String PHOTO_TITLE		=	"photo_title";
		String PHOTO_CREATE_TIME=	"photo_create_time";
	}
	
	public static class News {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_NEWS).build();
	}
	
	public static class Places implements PlacesColumns,BaseColumns{
		
	}

	public static class Plans implements PlacesColumns, PlansColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_PLANS).build();
		
		public static final String CONTENT_TYPE = 
			"vnd.android.cursor.dir/vnd.spotor.plan";
		public static final String CONTENT_ITEM_TYPE = 
			"vnd.android.cursor.item/vnd.spotor.plan";
		
		/**Build {@link Uri} for requested {@link #PLAN_ID}**/
		public static Uri buildPlanUri(String planId){
			return CONTENT_URI.buildUpon().appendPath(planId).build();
		}

		//根据Uri获得Plan Id
		public static String getPlanId(Uri uri) {
			// TODO Auto-generated method stub
			return uri.getPathSegments().get(1);
		}
		
	}

	public static class Blogs {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_BLOGS).build();
	}

	public static class Dreams {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_DREAMS).build();
	}

	public static class Friends {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_BLOGS).build();
	}

	public static class Photos {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_PHOTOS).build();
	}

	public static class States implements StatesColumns, BaseColumns {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_STATES).build();
	}
	
	public static class Mails {
		public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
				.appendPath(PATH_MAILS).build();
	}
}
